﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using PSE.Framework.Configuration;

namespace PSE.Updater.Common.Configurations.Monitor
{
    public class MonitorConfiguration
    {
        private static MonitorConfigurationSection _monitorConfigurations;
        private static MonitorConfiguration _monitor;

        private MonitorConfiguration() { }
        public static MonitorConfiguration Instance
        {
            get
            {
                if (_monitor == null)
                    _monitor = new MonitorConfiguration();

                return _monitor;
            }
        }

        /// <summary>
        /// Retorna as configurações do Monitor
        /// </summary>
        /// <returns>Configurações do Monitor</returns>
        public MonitorConfigurationSection GetSection()
        {
            if (_monitorConfigurations == null)
            {
                MonitorConfigurationSection section = ConfigurationManager.GetSection("monitorProviders") as MonitorConfigurationSection;

                //ApplicationConfiguration config = ApplicationConfiguration.GetCurrent();

                //MonitorConfigurationSection section = config.GetSection<MonitorConfigurationSection>("monitorProviders");

                _monitorConfigurations = section;
            }
            return _monitorConfigurations;
        }
    }
}